package com.example.day24;

/**
 * @author Lenovo
 */
public class ReflectDemo02 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<?> c = Class.forName("com.example.day24.Student");
        Constructor<?> con = c.getConstructor(String.class, int.class,
                String.class);
        Object obj = con.newInstance("张三", 18, "北京");
        System.out.println(obj);

    }
}
